package com.anjiplus.template.gaea.business.work.station.service.impl;

import com.anjiplus.template.gaea.business.work.station.dao.StationDao;
import com.anjiplus.template.gaea.business.work.station.entity.Station;
import com.anjiplus.template.gaea.business.work.station.service.StationService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 站点service实现类
 *
 * @author yxm
 */
@Service
public class StationServiceImpl implements StationService {

    private StationDao stationDao;

    StationServiceImpl(StationDao stationDao) {
        this.stationDao = stationDao;
    }

    /**
     * 查询全部站点列表
     *
     * @return
     */
    @Override
    public List<Station> listAll() {
        return stationDao.listAll();
    }

    /**
     * 根据站点名称模糊查询站点列表
     *
     * @param name
     * @return
     */
    @Override
    public List<Station> listByStationName(String name) {
        return stationDao.listByStationName(name);
    }

    /**
     * 添加站点
     *
     * @param station
     * @return
     */
    @Override
    public int add(Station station) {
        return stationDao.add(station);
    }

    /**
     * 移除站点
     *
     * @param id
     * @return
     */
    @Override
    public int remove(String id) {
        return stationDao.remove(id);
    }

    /**
     * 修改站点
     *
     * @param station
     * @return
     */
    @Override
    public int update(Station station) {
        return stationDao.update(station);
    }

}
